import vix from '@bairong/vix'
import { HELIOS_PREFIX } from './urls'

const { request } = vix

// 获取短信任务模板列表
export function getMessageListApi(data: object) {
  return request({
    url: `${HELIOS_PREFIX}/sms/task/template/list`,
    method: 'post',
    data
  })
}

// 新增短信模板
export function addTemplateApi(data: object) {
  return request({
    url: `${HELIOS_PREFIX}/sms/task/template/add`,
    method: 'post',
    data
  })
}

// 更新短信模板
export function updateTemplateApi(data: object) {
  return request({
    url: `${HELIOS_PREFIX}/sms/task/template/update`,
    method: 'post',
    data
  })
}

// 任务名称是否存在
export function templeteExistsApi(data: object) {
  return request({
    url: `${HELIOS_PREFIX}/sms/task/template/name/exist`,
    method: 'post',
    data
  })
}

// 启用禁用删除
export function changeTemplateStatusApi(data: object) {
  return request({
    url: `${HELIOS_PREFIX}/sms/task/template/status`,
    method: 'post',
    data
  })
}

// 获取短信模板
export function getSmsTemplateApi(data: object) {
  return request({
    url: `${HELIOS_PREFIX}/sms/task/template/smsTemplate`,
    method: 'post',
    data
  })
}

// 获取短信模版详情
export function getSmsDetailApi(data: object) {
  return request({
    url: `${HELIOS_PREFIX}/sms/task/template/getTemplateById`,
    method: 'post',
    data
  })
}
